package com.schoolegard.services;

import java.util.List;

import com.schoolgard.entitybean.GridDataModel;
import com.schoolgard.entitybean.Organization;
import com.schoolgard.entitybean.SchoolData;



public interface OrganizationService {
	
	/**
	 * 通过父节点查找所有子机构
	 * @param parentId
	 * @return
	 */
	public List<Organization> findByParentId(Long parentId);
	
	/**
	 * 根据id查找
	 * @param id
	 * @return
	 */
	public Organization findById(Long id);
	
	/**
	 * 查找所有组织数据
	 * @return
	 */
	public List<Organization> findAll();
	
	/**
	 * 根据区域id查找其下所有组织
	 * @param regionsId
	 * @return
	 */
	public List<Organization> findByRegions(Long regionsId);
	
	/**
	 * 查找第一层的节点，既是区域的直接子节点
	 * @param regionsId
	 * @return
	 */
	public List<Organization> find_level_1_ByRegions(Long regionsId);
	
	/**
	 * 保存或者更新组织
	 * @param org
	 */
	public void saveOrUpdate(Organization org);
	
	/**
	 * 删除组织
	 * @param orgId
	 */
	public void delete(Long orgId);
	
	public GridDataModel<SchoolData> findSchoolPage(SchoolData schoolData,int first,int max);
	
}
